package application.translators.impl;

import application.model.SignatureModel;
import application.model.SignaturesModel;
import application.translators.Translator;
import mappings.Signature;

import java.util.List;

public class SignaturesTranslator implements Translator<List<Signature>, SignaturesModel>
{
    @Override
    public SignaturesModel translate(List<Signature> input)
    {
        SignaturesModel signaturesModel = new SignaturesModel();

        for(Signature signature : input)
        {
            SignatureModel signatureModel = new SignatureModel();

            signatureModel.setCountryName(signature.getCountry().getName());
            signatureModel.setName(signature.getName());

            signaturesModel.addSignature(signatureModel);
        }

        return signaturesModel;
    }
}
